package com.bogo.webhook.feign.response;

import java.util.List;

public class WenxinResponse {

    private Data data ;

    public void setData(Data data) {
        this.data = data;
    }

    public String getText(){

        if (data == null || data.content == null || data.content.isEmpty()){
            return null;
        }

        String text = data.content.get(0).getData();

        return text == null ? null : text.replaceFirst("\n\n","");
    }

    public static class Data{
        private List<Content> content;

        public List<Content> getContent() {
            return content;
        }

        public void setContent(List<Content> content) {
            this.content = content;
        }
    }

    public static class Content{

        private String data;

        public String getData() {
            return data;
        }

        public void setData(String data) {
            this.data = data;
        }
    }
}
